package org.changneng.framework.frameworkbusiness.service.impl;


import org.changneng.framework.frameworkbusiness.dao.DeptMapper;
import org.changneng.framework.frameworkbusiness.entity.Dept;
import org.changneng.framework.frameworkbusiness.entity.DeptExample;
import org.changneng.framework.frameworkbusiness.service.DeptService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DeptServiceImpl implements DeptService {

    @Autowired
    private DeptMapper deptMapper;
    @Override
    public int insert(Dept dept) {
        return deptMapper.insert(dept);
    }

    @Override
    public List<Dept> selectAll() {
        return deptMapper.selectByExample(null);
    }

    @Override
    public int delete(int deptno) {
        return deptMapper.deleteByPrimaryKey(deptno);
    }

    @Override
    public int update(Dept dept) {
        return deptMapper.updateByPrimaryKeySelective(dept);
    }
}
